<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="css/unified.css" />
		<link rel="stylesheet" href="css/user.css" />
	</head>
	<body>
		<header class="mui-bar mui-bar-nav head00c694">
			<a class="mui-action-back iconfont  icon-more_unfold mui-icon mui-pull-left"></a>
			<h1 class="mui-title">注册</h1>
		</header>
		<form class="use-cont">
			<div class="input100box">
				<span class="iconfont  icon-Mobile-phone"></span>
				<input type="text" class=""  value="" placeholder="请输入您的手机号码" id="phone" name="phone" />
			</div>
			<div class="input100box input60">
				<span class="iconfont  icon-edit"></span>
				<input type="number" class=""  value="" placeholder="验证码" id="code" name="code"/>
				
			</div>
			<input type="button" class="input40"  value="获取验证码"/>
			
			<div class="input100box">
				<span class="iconfont  icon-similar-product"></span>
				<input type="text" class=""  value="" placeholder="请输入您的密码" id="pwd1" name="pwd1" />
			</div>
			<div class="input100box">
				<span class="iconfont  iconfont  icon-product-features"></span>
				<input type="text" class=""  value="" placeholder="请再次输入您的密码" id="pwd2" name="pwd2" />
			</div>
			
			<input type="button" class="btn100"  value="立即注册" id="registerbtn"/>
		</form>
		<script src="../js/mui.min.js"></script>
		<script type="text/javascript" src="../js/jquery-3.2.1.min.js" ></script>
		<script>
			mui.init();
			//注册页面 register.html的js文件
			
			
			$(function(){
				$('#registerbtn').on('tap',function(){
			//		点击注册
					var $phone = $('#phone').val();
					var $code = $('#code').val();
					var $pwd1 = $('#pwd1').val();
					var $pwd2 = $('#pwd2').val();
					if($phone == '' || $pwd == '' || $pwd2='' || $pwd1=''){
						alert('帐号密码验证码不能为空!');
						return false;
					}else {
						
						registerAjaxFn($phone,$code,$pwd1,$pwd2);
					}
				});
				
				$('.input40').on('tap',function(){
					//获取手机倒计时;
					$('.input40').attr('disabled',"false");
					var $phone = $('#phone').val();
//					调用接口
//					mui.getJSON( ,{ },function(data){
//						var strdata = JSON.stringify(data);
//						if(data.status == 'success'){
////							电话号码可用
//							alert(data.message);
//							settime($('.input40'));
//						}else{
////							电话号码不可用.重新启用验证码按钮
//							alert(data.message);
//							$('.input40').removeAttr('disabled');
//						}
//					});
					
				})
			})
			
			var tt;
			var countdown=60; 
			function settime(obj){
			//	obj.attr('disabled',"false");
				tt=setInterval(function(){
					obj.css('background','#999');
					obj.val('重新发送'+countdown+'s');
					countdown -- ;
					console.log(countdown);
					if(countdown <= 0){
						obj.removeAttr('disabled');
						clearInterval(tt);
						obj.val('获取验证码');
						obj.css('background','#E51143');
						countdown = 60;
					}
				},1000);
			}
		</script>
	</body>
</html>
